package com.example.bank.service.city;

import cn.hutool.core.util.StrUtil;
import com.example.bank.dao.CityDao;
import com.example.bank.exception.SystemException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author ：Leeziqiang
 * @description：TODO
 * @date ：2022/1/16 18:04
 */
@Service
@Transactional
public class CityServiceImpl implements CityService{

    @Autowired
    private CityDao cityDao;

    @Override
    public String getCode(String city) {
        if (StrUtil.isEmpty(city)) {
            throw new SystemException("city为空");
        }
        return cityDao.findCodeByCity(city);
    }
}
